// 引入vue-router
import { createRouter, createWebHistory } from "vue-router";

export const routerList = [
  {
    path: "/",
    name: "login",
    component: () => import("@/views/login.vue"),
  },
  {
    path: "/register",
    name: "register",
    component: () => import("@/views/register.vue"),
  },
  {
    path: "/main",
    name: "main",
    component: () => import("@/views/main/main.vue"),
  },
  {
    path: "/personal",
    name: "personal",
    component: () => import("@/views/personal/personal.vue"),
  },
  {
    path: "/number",
    name: "number",
    component: () => import("@/views/personal/number.vue"),
  },
  {
    path: "/personalData",
    name: "personalData",
    component: () => import("@/views/personal/personalData.vue"),
  },
  {
    path: "/password",
    name: "password",
    component: () => import("@/views/personal/password.vue"),
  },
  {
    path: "/update",
    name: "update",
    component: () => import("@/views/personal/update.vue"),
  },
  {
    path: "/history",
    name: "history",
    component: () => import("@/views/history/history.vue"),
  },
  {
    path: "/borrow",
    name: "borrow",
    component: () => import("@/views/borrow/borrow.vue"),
  },
];

// 实例化vueRouter并将routers添加

export default createRouter({
  history: createWebHistory(),
  routes: [...routerList],
});
